package com.jsbb.controller.sys;

import com.jsbb.annotation.ApiLog;
import com.jsbb.common.Message;
import com.jsbb.dto.sys.SysLogQueryDto;
import com.jsbb.service.sys.SysLogService;
import com.jsbb.vo.PageVo;
import com.jsbb.vo.sys.SysLogVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统日志Controller
 *
 * @author w
 * @date 2021-03-08
 */
@Slf4j
@RestController
@RequestMapping("/sys/log")
@ApiLog("系统日志")
@Api(tags = {"2.4 系统管理-系统日志"})
public class SysLogController {

    @Autowired
    private SysLogService sysLogService;

    @PostMapping("/list")
    @ApiOperation(value = "获取列表")
    public Message<PageVo<SysLogVo>> list(@Validated @RequestBody SysLogQueryDto queryDto) {
        PageVo<SysLogVo> pageVo = sysLogService.list(queryDto);
        return Message.success(pageVo);
    }
}
